package com.wenson.behavior.strategy;

/**
 * @ClassName: StrategyClient
 * @Author: luowangcheng
 * @Date: 2024/6/15 17:12
 * @Description:
 */
public class StrategyClient {
    public static void main(String[] args) {
        Calculator calculator = new Calculator();
        calculator.setStrategy(new Addition());
        System.out.println(calculator.getResult(1, 1));

        calculator.setStrategy(new Subtraction());
        System.out.println(calculator.getResult(1, 1));
    }
}
